<template>
	<view class="upload">
		<view class="status_bar" :style="{height: statusBarHeight + 'px'}">
		</view>
		<view class="content" :style="{height: height + 'px'}">
			<div class="choosefile" style="display: none;">
				<view class="title">嗨小律</view>
				<view class="main_box">
					<image src="/static/image/upload/files.png" class="files"></image>
					<button class="choose_wx" @click="chooseWxFile">选择微信聊天中的文件</button>
					<ul class="desc">
						<li>1、支持docx、PDF文件格式</li>
						<li>2、单次最多选择10个文件</li>
						<li>3、单个文件不超过10M</li>
						<li>4、已过期的聊天文件、无法导入</li>
					</ul>
				</view>
			</div>
			<filelistVue/>
		</view>
	</view>

	
</template>

<script>
	import filelistVue from '../../../components/filelist/filelist.vue';
	export default {
		data() {
			return {
				statusBarHeight: null,
				height: null
			}
		},
		components: {
			filelistVue
		},
		methods: {
			chooseWxFile() {
				wx.chooseMessageFile({
					count: 10,
					type: 'file',
					success(res) {
						console.log(res)
						res.tempFiles.forEach(item => {
							console.log(item)
						})
					}
				})
			},
		},
		mounted() {
			this.statusBarHeight = uni.getWindowInfo().statusBarHeight
			this.height = uni.getWindowInfo().windowHeight - uni.getWindowInfo().statusBarHeight
		}
	}
</script>

<style lang="scss" scoped>
@import 'chooseFiles.scss';
</style>
